#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

import os
import argparse

parser = argparse.ArgumentParser()
parser.add_argument(
    '-r'
    ,type=str
    ,help='path to rsf'
    ,required=True
)
parser.add_argument(
    '-i'
    ,type=str
    ,help='path to idx2node.txt'
    ,required=True
)
args = parser.parse_args()

with open(args.i,'r') as f:
    lines = f.readlines()
    idx2node = {}
    for line in lines:
        tokens = line.split()
        idx2node[int(tokens[0])]=tokens[1]

with open(args.r,'r') as f:
    lines = f.readlines()
    for line in lines:
        tokens = line.split()
        print(f"contain {tokens[1]} {idx2node[int(tokens[2])]}")
